﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FineUIMvc
{
    public static partial class FineUIMvcExtensions
    {
        /// <summary>
        /// 绑定CheckBoxList示例
        /// </summary>
        /// <param name="cbl"></param>
        /// <param name="checkItemList"></param>
        public static void Bind(this CheckBoxListAjaxHelper cbl, List<CheckItem> checkItemList) 
        {
            cbl.LoadData(checkItemList.ToArray());
        }

        /// <summary>
        /// 绑定CheckBoxList示例
        /// </summary>
        /// <param name="cbl"></param>
        /// <param name="dataSource">数据源</param>
        /// <param name="dataTextField">文本字段</param>
        /// <param name="dataValueField">值字段</param>
        public static void Bind(this CheckBoxListAjaxHelper cbl,object dataSource,string dataTextField, string dataValueField) 
        {
            cbl.DataSource(dataSource,dataValueField,dataTextField);
        }
    }
}
